<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ระบบประกันคุณภาพการผลิต :: QI Management</title>
<script src="<?php echo base_url();?>js/knockout-1.2.1.js"></script> 
 

<script src="<?php echo base_url();?>js/jquery-1.7.1.min.js"></script>
<script src="<?php echo base_url();?>js/kendo.dataviz.min.js"></script>
<script src="<?php echo base_url();?>js/kendo.all.min.js"></script>

<link href="<?php echo base_url();?>css/kendo.common.min.css" rel="stylesheet" />
<link href="<?php echo base_url();?>css/kendo.default.min.css" rel="stylesheet" />
<!-- <link href="<?php echo base_url();?>css/t-tech.css" rel="stylesheet" /> -->
<link href="<?php echo base_url();?>css/t-tech-style.css" rel="stylesheet" />
</head>
<body>


<div id="example" class="k-content">

			<div id="shipping">
			<span id="loading"></span>
            <label for="input" class="info">Username :</label>

            <input id="username" class="k-textbox" />
	 		<label for="input" class="info">Password :</label>

            <input type='password' class="k-textbox" id="password" />
            <br>
            <button class="k-button" id="login">Login</button>
			</div>
 <style scoped="scoped">
                .info {
                    display: block;
                    line-height: 22px;
                    padding: 0 5px 5px 0;
					color: #36558e;
                }

				#shipping {
					width: 900px;
					height: 563px;
					padding: 210px 0 0 400px;
					background: url('<?php echo base_url();?>/images/loginbox.png') transparent no-repeat 0 0;
					margin: 0px auto;
 				}

                .k-autocomplete
                {
                    width: 250px;
					vertical-align: middle;
                }

                .hint {
                    line-height: 22px;
                    color: #aaa;
                    font-style: italic;
					font-size: .9em;
					color: #7496d4;
                }
            </style>
 </div>
 
 <script>
                $(document).ready(function() {
                	 var loading = "<center><img src='<?=base_url(); ?>css/BlueOpal/loading-image.gif?>'></center>"
                	 $("#login").click(function() {
                		 $.ajax({
								url:"<? echo base_url()?>index.php/login/checkLogin",
								type: 'post',
								data : ({
										type : "person" , 
										username : $("#username").val(),										
										password : $("#password").val(),
									 
										}) ,
								beforeSend: function(){
											$(".status").html(loading);
										},
								success : function(rs){
										  // alert(rs);
											if(rs == '1'){
												$("#loading").html(loading);
												window.location="<? echo base_url()?>index.php/application/";
											}else{
												$("#loading").html('ตรวจสอบ Username และ Password ใหม่');
											// 	apprise('user มีผู้ใช้แล้ว', {'animate':true});
											}
										}	  
                		 	  });
                	 });
                });

 </script>